package com.sjgtw.cloud.util;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public class FileUtil {
	public static String readFile(InputStream fis) {
		try {
			Reader reader = new InputStreamReader(fis, "utf-8");
			int ch;
			StringBuffer sb = new StringBuffer();
			while ((ch = reader.read()) != -1) {
				sb.append((char) ch);
			}
			reader.close();
			return sb.toString();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}
